var protocolHtml ="";
function initProtocol(targetId, inputTargeId){
	$(targetId).on('click',function(){
		//页面层
		var alertIndex = layer.open({
		  type: 1,
		  title: false,
		  area: ['570px', '638px'], //宽高
		  content: protocolHtml
		});
		$('#agree-btn').on("click",function(){
			$(inputTargeId).attr('checked','checked');
			layer.close(alertIndex);
		});
		$('#disagree-btn').on("click",function(){
			$(inputTargeId).removeAttr('checked');
			layer.close(alertIndex);
		});
	});
}
function loadProtocol() {
    $.ajax({
        type: "GET",
        url: urlPath + "api/dict?dictType=v_biz_protocol&dictValue=2",
        success: function (data) {
            if (data.code == "0" && data.data.length > 0) {
                var result = data.data[0];
                protocolHtml+= '<div class="login-center"><div class="agreeTitle" style="">通河县数字文化馆</div><div class="form-box phone-login-form agree-content">';
        		protocolHtml+=result.description;
        		protocolHtml+='</div>';
        		protocolHtml+='<div class="agree-btn">';
        		/*protocolHtml+='<a id="disagree-btn">不同意</a>';*/
        		protocolHtml+='<a class="red" id="agree-btn" onclick="check()">同意</a>';
        		protocolHtml+='</div>';
        		protocolHtml+='</div>';
            }
            else {
            	layer.msg(data.msg);
            }
        }
    });
}
loadProtocol();
//点击同意，前面的同意框 勾选勾中
 function  check(){
 	$("#accountStatement").prop("checkbox",true);

}
	